package chapter07

import scala.collection.mutable

/**
  * 集合之可变Set
  */
object Test07_MutableSet {

  def main(args: Array[String]): Unit = {
    val set = mutable.Set.apply(13, 13, 14, 14, 15, 16, 17)

    // 添加元素
    set += 12
    set.add(22)
    println(set)

    // 删除元素
    set -= 12
    set.remove(22)
    println(set)

    // 合并set
    val set2 = mutable.Set.apply(66)
    set ++= set2
    println(set)

  }
}
